feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator#537
Closed
RMillerCohort251 wants to merge 1 commit intocode-differently:mainfrom
Closed
feat: RMiller_lesson_17_adds moneyorder and auditlog ATM simulator#537RMillerCohort251 wants to merge 1 commit intocode-differently:mainfrom
RMillerCohort251 wants to merge 1 commit intocode-differently:mainfrom
Conversation
anthonydmays
requested changes
Apr 23, 2025
|
|
||
| import java.util.UUID; | ||
|
|
||
| public class MoneyOrder extends Check { |
Contributor
There was a problem hiding this comment.
A money order is not a check.
| @BeforeEach | ||
| void setUp() { | ||
| classUnderTest = new BankAtm(); | ||
| new BankAtm(); |
|
|
||
| @Test | ||
| void testDepositFunds() { | ||
| // Act |
|
|
||
| MoneyOrder moneyOrder = new MoneyOrder(sourceAccount, amount); | ||
|
|
||
| assertEquals(initialBalance - amount, sourceAccount.getBalance(), 0.001); |
Contributor
There was a problem hiding this comment.
Test is difficult to read. Would've been better like this:
// Arrange
var sourceAccount = new CheckingAccount("TRG456", Set.of(bob), 1000.0);
// Act
var moneyOrder = new MoneyOrder(sourceAccount, 250);
// Assert
assertEquals(750.0, sourceAccount.getBalance(), 0.001);Remember that we prefer our tests to be DAMP, not DRY.
| AuditLog.getInstance().log("CHECK DEPOSIT", account.getAccountNumber(), check.getAmount()); | ||
| } | ||
|
|
||
| public void depositFunds(String accountNumber, MoneyOrder mo) { |
Contributor
There was a problem hiding this comment.
You were not to add any new methods.
Contributor
|
Your pull request names are STILL not following convention. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created a MoneyOrder class that integrates with the BankAtm class. Created an AuditLog class that keeps a record of all debits and credits to any account and integrate it with the BankAtm class.